package Task0;

import java.util.ArrayList;

public class Demo7 {
    public static void main(String[] args) {
        String[] str = {"12321","45678","66789","12345678909","45678","12345678909"};
        ArrayList al=new ArrayList<>();
        for (int i = 0; i < str.length; i++) {
            al.add(str[i]);
        }
        for (int i = 0; i < al.size(); i++) {
            for (int j = 0; j < al.size(); j++) {
                if (i!=j&&al.get(i)==al.get(j)){
                    al.remove(al.get(j));
                }
            }
        }System.out.println(al);
    }
}
/*
7.已知String数组中存放了QQ号码，QQ号码最长为11位，最短为5位

        String[] str = {"12321","45678","66789","12345678909","45678","12345678909"};

        将该数组的所有qq号都存放在ArrayList中，并且保证ArrayList中的qq号没有重复的打印出来*/
